﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MvcEngine.Mvc.Filters;
using System.Web;
using System.Web.Routing;
using MvcEngine.Blog.Models.Entities;
using MvcEngine.Core;
using MvcEngine.Blog.Repositories;
using MvcEngine.Blog.Helper;
using MvcEngine.Blog.Managers;

namespace MvcEngine.Blog.Components.Attributes
{
    public class BlogActionSetupAttribute : PageHeaderAttribute
    {
        public override PageHeader Get(RequestContext requestContext)
        {
            BlogData blog = BlogManager.Current.GetCurrentBlog();
            if (blog != null)
            {
                return new PageHeader()
                {
                    Title = blog.BlogName + " | " + blog.BlogDescription,
                };
            }
            return null;
        }
    }
}
